<?php
/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Vote
 * @copyright  Copyright 2011 KEENONWEB LLC
 * @license    http://www.keenonweb.com/
 * @version    $Id: promote.tpl 2011-03-09 01:11:30 idris $
 * @author     Idris
 */
?>

<div class="smoothbox-container">

  <div class="kowcore-header">
    <h3>
      <?php echo $this->translate('Suggest to Friends'); ?>
    </h3>
  </div>

  <div class="description">
    <?php echo $this->translate('KOWCORE_SUGGEST_FRIENDS_DESCRIPTION'); ?>
  </div>
  
  <br />

<form action="<?php echo $this->url(array('controller' => 'promotion', 'action' => 'promote'), 'kowcore_extended'); ?>" method="post" id="promote-form">

<div class="kowcore-list">
  <div class="kowcore-list-wrapper">

    <?php if ($this->paginator->getTotalItemCount()): ?>

    <?php if ($this->page > 1): ?>
      <div class="pagination pag-top">
        <?php echo $this->htmlLink($this->url( array( 'action' => 'promote', 'controller' => 'promotion', 'page' => ($this->page-1) ), 'kowcore_extended' ), $this->translate('Previous')); ?>
      </div>
      <div class="clr"></div>
    <?php endif; ?>

<?php
  echo $this->partial('smoothbox/choose_list.tpl', 'kowcore', array(
    'paginator' => $this->paginator
  ));
?>

    <?php if (count($this->paginator) > 1): ?>
      <div class="pagination pag-bottom">
        <?php echo $this->htmlLink($this->url( array( 'action' => 'promote', 'controller' => 'promotion', 'page' => ($this->page+1) ), 'kowcore_extended' ), $this->translate('Next')); ?>
      </div>
    <?php endif; ?>
    
    <?php else: ?>

    <div class="tip">
      <span>
        <?php echo $this->translate('No results found.');?>
      </span>
    </div>

    <?php endif; ?>

    <div class="clr"></div>
  </div>
</div>

<?php $this->headScript()->appendFile($this->baseUrl().'/application/modules/Kowcore/externals/scripts/core.js'); ?>
<script type="text/javascript">
en4.core.runonce.add(function(){
  var promote = new en4.kowcore.promotion({
    'defaults': {
      'title': '<?php echo $this->translate('Subject...'); ?>',
      'message': '<?php echo $this->translate('Message...'); ?>'
    }
  });
});
</script>

<div class="message-container">

  <div class="error-container hidden" id="error-container">

  </div>
  
  <div class="form-wrapper">
    <div class="form-element">
      <input type="text" name="subject" id="promote-subject" class="default" value="<?php echo $this->translate('Subject...'); ?>" />
    </div>
    <div class="clr"></div>
  </div>
  
  <div class="form-wrapper">
    <div class="form-element">
      <textarea class="default" id="promote-message" name="message"><?php echo $this->translate('Message...'); ?></textarea>
    </div>
    <div class="clr"></div>
  </div>

  <div class="form-wrapper">
    <div class="form-element">
      <button type="submit" class="button"><?php echo $this->translate('Send Message'); ?></button>
      <?php echo $this->translate('or'); ?>
      <a href="javascript:void(0)" onclick="window.parent.Smoothbox.close();"><?php echo $this->translate('cancel'); ?></a>
    </div>
    <div class="clr"></div>
  </div>
  
</div>

</form>

</div>